﻿@model IEnumerable<WebInstagram.Models.Photo>

@{
    ViewBag.Title = "Recent photos";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<style type="text/css">
    .hoverimg {
        cursor: hand;
        cursor: pointer;
    }
</style>
<div class="row">
    <div class="col-md-12">
        <h2>Recent photos</h2>

        @foreach (var photo in Model)
        {

            <div class="col-md-2">
                <a href="~/Photo/Details/@photo.Id">
                    <img src="data:image/jpg;base64,@(Convert.ToBase64String(photo.Image))"
                         style="width:160px; height:200px"
                         class="hoverimg"
                </a>
                <a href="~/Home/Index?userName=@photo.User">@photo.User</a>
            </div>
         }       
    </div>
</div>
